package helpers;

import java.sql.ResultSet;

//NAO UTILIZADO

import android.app.Activity;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.util.Log;

public class Database{

	private static SQLiteDatabase db = null;	
	
	public static void initialize(SQLiteDatabase db){
		Database.db = db;
	}
	
	private static boolean initialized(){
		return db != null;
	}
	
	public static void run(String query){
		if(!initialized())
			return;
		
		db.execSQL(query);
	}
	
	public static Cursor get(String query){
		if(!initialized())
			return null;
		
		Cursor c = db.rawQuery(query, null);
		c.moveToFirst();
		
		return c; 
	}
	
}
